home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / util / edit / ced_programs.lha / CED-Programs / Left-C-Comment.ced < prev    next >
Text File  |  1993-02-14  |  861b  |  51 lines

  1. /*
  2.  * Left-C-Comment.ced
  3.  *
  4.  * Put a nice C-style comment on the left hand side of the current block
  5.  * or current line.
  6.  *
  7.  * Author: Stefan Winterstein (winter@cs.uni-sb.de)
  8.  * Status: Public Domain
  9.  *
  10.  */
  11.  
  12. LF  = '0A'X
  13.  
  14. options results        /* Allow CygnusEd to pass status variables */
  15.  
  16. address 'rexx_ced'    /* Tell ARexx to talk to CygnusEd */
  17.  
  18. status 47            /* get current line number */
  19. start = result
  20.  
  21. status 69            /* get start of block */
  22.     end = result
  23.  
  24. if end = -1 then do    /* No block marked */
  25.     end = start+1
  26. end
  27. else do
  28.     'mark block'        /* turn block marking off */
  29. end
  30.  
  31.  
  32. if start > end then do    /* swap start with end */
  33.     t = start
  34.     start = end
  35.     end = t
  36. end
  37.  
  38. 'jump to line' start+1    /* goto start of block */
  39. 'text' '/*'LF
  40.  
  41. do line = start while line < end
  42.     'text' ' * '
  43.     'beg of line'
  44.     'down'
  45. end
  46. 'text' ' */'LF
  47.  
  48. 'jump to line' start+1    /* reset cursor */
  49.  
  50. exit
  51.